package com.itfreer.cms.dao.module;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

import org.springframework.beans.BeanUtils;

import com.itfreer.cms.entity.module.LinkEntity;
import com.itfreer.form.api.JdbcBaseEntity;

@Entity(name = "cms_link")
public class JdbcLinkEntity implements JdbcBaseEntity<LinkEntity>, Serializable {

	private static final long serialVersionUID = -7040201788965745098L;

	/**
	 * id值，主键，唯一值
	 * 系统应用中必需关联此值
	 */
	@Id
	@Column(name = "id", length = 50, nullable = false)
	private String id;
	
	/**
	 * 站点名称
	 */
	@Column(name = "s_siteid", length = 20, nullable = true)
	private String siteId;
	
	/**
	 * 网站名称
	 */
	@Column(name = "s_linkName", length = 50, nullable = false)
	private String linkName;

	/**
	 * 网站地址
	 */
	@Column(name = "s_linkAddress", length = 50, nullable = false)
	private String linkAddress;

	/**
	 * 图片地址
	 */
	@Column(name = "s_pictureAddress", length = 500, nullable = true)
	private String pictureAddress;

	/**
	 * 站长Email
	 */
	@Column(name = "s_email", length = 50, nullable = true)
	private String email;

	/**
	 * 网站描述
	 */
	@Column(name = "s_describe", length = 4000, nullable = true)
	private String describe;

	/**
	 * 推荐
	 */
	@Column(name = "b_recommend", length = 10, nullable = true)
	private Boolean recommend;

	/**
	 * 状态
	 */
	@Column(name = "s_state", length = 10, nullable = true)
	private String state;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getLinkName() {
		return linkName;
	}

	public void setLinkName(String linkName) {
		this.linkName = linkName;
	}

	public String getLinkAddress() {
		return linkAddress;
	}

	public void setLinkAddress(String linkAddress) {
		this.linkAddress = linkAddress;
	}

	public String getPictureAddress() {
		return pictureAddress;
	}

	public void setPictureAddress(String pictureAddress) {
		this.pictureAddress = pictureAddress;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getDescribe() {
		return describe;
	}

	public void setDescribe(String describe) {
		this.describe = describe;
	}

	public Boolean getRecommend() {
		return recommend;
	}

	public void setRecommend(Boolean recommend) {
		this.recommend = recommend;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	
	public String getSiteId() {
		return siteId;
	}

	public void setSiteId(String siteId) {
		this.siteId = siteId;
	}

	@Override
	public void from(LinkEntity t) {
		BeanUtils.copyProperties(t, this);
	}

	@Override
	public LinkEntity toEntity() {
		LinkEntity toEntity = new LinkEntity();
		BeanUtils.copyProperties(this, toEntity);
		return toEntity;
	}
}